package com.example.chesstest;

import android.os.Bundle;

import android.app.Activity;
import android.view.Menu;
import android.widget.GridView;

public class Game extends Activity {
	
	String turn = "whiteTurn";
	boolean hasMovedTurn = false;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		  setContentView(R.layout.playground);
		  
		  final GridView chessboardGridView = 
		    (GridView)findViewById(R.id.chessboard);
		  chessboardGridView.setAdapter(new SquareAdapter(this));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.chessboard, menu);
		return true;
	}
	
	public void checkTurn(){
		if(turn=="whiteTurn"&&hasMovedTurn==true){
			turn ="blackTurn";
			hasMovedTurn=false;
		}else if(turn=="blackTurn"&&hasMovedTurn==true){
			turn = "whiteTurn";
			hasMovedTurn=false;
		}else{
			System.out.println("Error: didn't found player");
		}
		System.out.println(turn);
	}

}
